//
//  MyInformationVC.m
//  Logistics
//
//  Created by enzhoukeji on 2018/8/9.
//  Copyright © 2018年 puyue.com. All rights reserved.
//

#import "MyInformationVC.h"
#import "MyInforTVCell.h"
@interface MyInformationVC ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic,strong) UITableView * informationTV;

@end

@implementation MyInformationVC
-(UITableView *)informationTV{
    if (!_informationTV) {
        _informationTV = [[UITableView alloc]initWithFrame:CGRectMake(0,  kMainTopHeight , kMainScreen_width  , kMainScreen_height - GTFixHeightFlaot(37)) style:UITableViewStyleGrouped];
        _informationTV.backgroundColor = [UIColor colorWithRed:229/255.0 green:229/255.0 blue:229/255.0 alpha:1];;
        _informationTV.showsVerticalScrollIndicator = NO;
//        _informationTV.separatorStyle = UITableViewCellSeparatorStyleNone;
        _informationTV.dataSource = self;
        _informationTV.delegate = self;
    }
    return _informationTV;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navTitle = @"我的信息";
    [self.view addSubview:self.informationTV];
    // Do any additional setup after loading the view.
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 3;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
   
    if (section ==0) {
        return 1;
    }else if (section == 1){
        return 2;
    }else{
        return 2;
    }
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.section == 0) {
        MyInforTVCell *cell=[tableView dequeueReusableCellWithIdentifier:@"MyInforTVCell"];
        if (!cell) {
            cell=[[MyInforTVCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyInforTVCell"];
        }
        return cell;
    }else if(indexPath.section == 1){
        MyInforTVCellSecond *cell=[tableView dequeueReusableCellWithIdentifier:@"MyInforTVCellSecond"];
        if (!cell) {
            cell=[[MyInforTVCellSecond alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyInforTVCellSecond"];
        }
        if (indexPath.row == 0) {
            cell.headLabel.text = @"实名认证";
            cell.nameLabel.text = @"甄姬";
        }else{
            cell.headLabel.text = @"联系方式";
            cell.nameLabel.text = @"18177181161";
        }
        return cell;
    }else{
        MyInforTVCellSecond *cell=[tableView dequeueReusableCellWithIdentifier:@"MyInforTVCellSecond"];
        if (!cell) {
            cell=[[MyInforTVCellSecond alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MyInforTVCellSecond"];
        }
        if (indexPath.row == 0) {
            cell.headLabel.text = @"公司名称";
            cell.nameLabel.text = @"看见爱上道具卡十多块";
        }else{
            cell.headLabel.text = @"公司地址";
            cell.nameLabel.text = @"那么，电脑啊思密达，是";
        }
        return cell;
    }
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.section == 0) {
        return GTFixHeightFlaot(60);
    }else {
        return GTFixHeightFlaot(40);
    }
    
}
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    return nil;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 0.01;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
    return nil;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
    if (section == 2) {
         return GTFixHeightFlaot(5);
    }else{
        return GTFixHeightFlaot(0.01);
    }
}
-(void)viewDidLayoutSubviews {
    
    if ([self.informationTV respondsToSelector:@selector(setSeparatorInset:)]) {
        [self.informationTV setSeparatorInset:UIEdgeInsetsZero];
    }
    if ([self.informationTV respondsToSelector:@selector(setLayoutMargins:)])  {
        [self.informationTV setLayoutMargins:UIEdgeInsetsZero];
    }
}
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPat{
    if ([cell respondsToSelector:@selector(setLayoutMargins:)]) {
        [cell setLayoutMargins:UIEdgeInsetsZero];
    }
    if ([cell respondsToSelector:@selector(setSeparatorInset:)]){
        [cell setSeparatorInset:UIEdgeInsetsZero];
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
